package com.cf.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cf.domain.pojo.Certificate;
import com.cf.domain.pojo.News;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CertificateMapper extends BaseMapper<Certificate> {

    @Select("SELECT id, competition, project_name, team_name, names, prize, start_time, create_time, images" +
            " FROM t_certificate WHERE enable=0 AND (project_name LIKE CONCAT('%', #{content}, '%') OR team_name LIKE CONCAT('%', #{content}, '%') OR names LIKE CONCAT('%', #{content}, '%'))")
    @Results({
            @Result(property = "projectName", column = "project_name"),
            @Result(property = "teamName", column = "team_name"),
            @Result(property = "startTime", column = "start_time"),
            @Result(property = "createTime", column = "create_time")
    })
    List<Certificate> search(@Param("content") String content);
}
